﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using HM.BusinessLayer;
using HM.DataLayer;

namespace HM.Service
{
    public class HMService : IHMService
    {
        private BusinessLogic bl = new BusinessLogic();

        #region Add

        public void AddTenant(Tenant tenant)
        {
            bl.AddTenant(tenant);
        }

        public void AddPayment(Payment payment)
        {
            bl.AddPayment(payment);
        }

        public void AddExpense(Expense expense)
        {
            bl.AddExpense(expense);
        }

        public void AddRegularExpense(RegularExpense regularExpense)
        {
            bl.AddRegularExpense(regularExpense);
        }

        #endregion

        #region Get

        public IEnumerable<Tenant> GetTenants()
        {
            return bl.GetTenants();
        }

        public IEnumerable<Payment> GetPayments()
        {
            return bl.GetPayments();
        }

        public IEnumerable<Payment> GetPaymentsByTenantsId(int tenantId)
        {
            return bl.GetPaymentsByTenantsId(tenantId);
        }

        public IEnumerable<Payment> GetPaymentsByDateRange(DateTime from, DateTime to)
        {
            return bl.GetPaymentsByDateRange(from, to);
        }

        public IEnumerable<RegularExpense> GetRegularExpenses()
        {
            return bl.GetRegularExpenses();
        }

        public IEnumerable<Expense> GetExpenses()
        {
            return bl.GetExpenses();
        }

        public IEnumerable<Expense> GetExpensesByDateRange(DateTime from, DateTime to)
        {
            return bl.GetExpensesByDateRange(from, to);
        }

        public Decimal? GetCash()
        {
            return bl.GetCash();
        }

        public Decimal? GetCashForThisMonth()
        {
            return bl.GetCashForThisMonth();
        }
 
        #endregion

        #region Save

        public void SaveTenants(IEnumerable<Tenant> tenants)
        {
            bl.SaveTenants(tenants);
        }

        public void SaveRegularExpenses(IEnumerable<RegularExpense> regularExpenses)
        {
            bl.SaveRegularExpenses(regularExpenses);
        }

        public void SaveExpenses(IEnumerable<Expense> expenses)
        {
            bl.SaveExpenses(expenses);
        }

        public void SavePayments(IEnumerable<Payment> payments)
        {
            bl.SavePayments(payments);
        }

        #endregion

        #region Remove

        public void RemoveTenant(Tenant tenant)
        {
            bl.RemoveTenant(tenant);
        }

        public void RemoveRegularExpense(RegularExpense regularExpense)
        {
            bl.RemoveRegularExpense(regularExpense);
        }

        public void RemoveExpense(Expense expense)
        {
            bl.RemoveExpense(expense);
        }

        public void RemovePayment(Payment payment)
        {
            bl.RemovePayment(payment);
        }

        #endregion
    }
}
